<?php
class ActionFriendsMap extends Action {
    
        public function Init() {                
            $this->SetDefaultEvent('index');                
        }
        /**
         * Регистрация эвентов
         *
         */
        protected function RegisterEvent() {
            $this->AddEvent('index','EventIndex');           
        }
        /**
         * Метод эвента index
         *
         */
        protected function EventIndex() { 
            if(!$this->User_IsAuthorization()) {
                return $this->EventNotFound();
            }   
            $oUser = $this->User_GetUserCurrent(); 
            $aUsersFriend = $this->User_GetUsersFriend($oUser->getId());
            $arr = array();
            foreach($aUsersFriend as $oUserFriend)
            {
               if ($oUserFriend->getProfileMap())
               {
                  $sFriendData = "";
                  $sFriendData .= $oUserFriend->getLogin()."%";  
                  $sFriendData .= $oUserFriend->getProfileName()."%";  
                  $sFriendData .= $oUserFriend->getProfileAvatarPath(24)."%"; 
                  $sFriendData .= $oUserFriend->getProfileMap();
                  array_push($arr, $sFriendData); 
               }
            }  
            $this->Viewer_Assign('aGeoList',$arr);    
            $this->SetTemplateAction('friendsmap');
        }       
        /**
         * Вызывается автоматически после выполнения эвента
         *
         */
        public function EventShutdown() {
                $this->Viewer_Assign('sText','Event complete');
        }
}
?>
